import request from '@/utils/request'

// 获取所有部门
export function getDepartments() {
  return request({
    url: 'company/department'
  })
}

// 获取部门信息
export function lodDepartments(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 新增部门
export function upDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 修改部门
export function upDateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除部门
export function delDateDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
